/**
 * Copyright [2020] [LiBo/Alex of copyright liboware@gmail.com ]
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.callcenter;

import com.hyts.callcenter.engine.delayed.anno.EnableDelayedQueue;
import com.hyts.calllcenter.registry.EmbeddedZooKeeper;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


/**
 * @project-name:callcenter
 * @package-name:com.hyts.callcenter
 * @author:LiBo/Alex
 * @create-date:2021-12-04 11:59 下午
 * @copyright:libo-alex4java
 * @email:liboware@gmail.com
 * @description:
 */
@Slf4j
@EnableDelayedQueue
@EnableDubbo
@MapperScan("com.hyts.callcenter.storage.db.mapper")
@SpringBootApplication
public class EngineApplication {


    public static void main(String[] args) {
        try {
            if(!EmbeddedZooKeeper.isPortUsing("127.0.0.1",2181)){
                EmbeddedZooKeeper.laucher();
            }
            SpringApplication.run(EngineApplication.class,args);
        } catch (Exception e) {
            log.error("启动我失败！",e);
        }
    }
}
